<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>数据对象合并</title>
  <script src="vue.js"></script>
</head>
<body>
<script>
  var mixin = {
      data () {
        return { message: 'happy' }
      }
    }
  var vm = new Vue({
      mixins: [mixin],
      data () {
        return { message: 'lucky' }
      },
      created () {
        console.log(this.$data.message) // 输出结果：lucky
      }
   })
</script>
</body>
</html>